package com.itheima.admin.controller;

import com.itheima.admin.pojo.AdChannel;
import com.itheima.admin.service.AdChannelService;
import com.itheima.common.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class ApiController {
    @Autowired
    private AdChannelService adChannelService;
    /**
     * 远程调用 查询频道列表
     * @return
     */
    @GetMapping("/api/channel/list")
    public ResultVo<List<AdChannel>> getChannelList(){
        List<AdChannel> list = adChannelService.list();
        return ResultVo.ok(list);
    }
}
